package com.api.wall.deletefromgroup;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.test.context.ContextConfiguration;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import com.api.test.AbstractApiTest;
import com.zyncro.api.IWallApiService;
import com.zyncro.api.exceptions.ZyncroApiException;

@ContextConfiguration(locations = { "classpath:/wall/wall-context.xml" })
public class DeleteFromGroup extends AbstractApiTest {

	@Value("#{group_toPublish[commenter].appId}")
	private String userUrn;

	@Value("#{group_toPublish[commenter].password}")
	private String userPassword;

	@Value("#{group_toPublish.urn}")
	private String groupUrn;

	private String groupEventUrn;

	@BeforeClass
	protected void setParameters() throws Exception {

		getApi().login(userUrn, userPassword);

		this.groupEventUrn = getApi().getService(IWallApiService.class).publishInGroup(groupUrn, "comentario", null, null, null, null,
				null, null, false, false, false);

	}

	@Test
	public void testPublishCompanyFeed() throws ZyncroApiException {

		getApi().getService(IWallApiService.class).deleteFromGroup(groupUrn, groupEventUrn);
	}
}
